#ifndef _MEMBER_BCOMBOBOX_H_
#define _MEMBER_BCOMBOBOX_H_

#include <BLine2>
#include <BRect>
#include <BStyle>
#include "ILineBlock.h"
#include "IComboBoard.h"
#include "IAlignment.h"

#define combox_member(combox)		((member_BComboBox*)((BComboBox*)combox)->_ptr)

namespace BWE
{
	class member_BComboBox : public BObject
	{
		friend class BComboBox;
	public:
		member_BComboBox(BComboBox* comboBox);
		~member_BComboBox();

		void emitEdited();

		bool imageShown();
		void freshRects();
		BLine2 inputLine();

		void slotArrowChecked(BObject* object, const BValue& value);

		void slotBoardClicked(BObject* object, const BValue& value);
		void slotBoardStyled(BObject* object, const BValue& value);

		void slotItemColorChanged(BObject* object, const BValue& vaue);
		void slotItemGraphChanged(BObject* object, const BValue& vaue);
		void slotItemImageChanged(BObject* object, const BValue& vaue);
		void slotItemIconChanged(BObject* object, const BValue& vaue);
		void slotItemValueChanged(BObject* object, const BValue& vaue);
		void slotItemTextChanged(BObject* object, const BValue& value);

		BComboBox*			boss;
		bool				editable;
		bool				readOnly;
		BSize				iconSize;
		BSize				arrowSize;
		BComboItem*			current;
		BValue				value;
		BReal				blinkTick;
		BReal				blinkTime;
		bool				blinkShown;
		bool				popupOnClick;

		bool				dirty;
		IAlignment			alignment;
		ILineBlock			block;

		bool				editing;
		BReal				focusedTime;
		bool				pressed;
		int					pressIndex;
		int					hoverIndex;

		BHolder<BButton>	arrow;
		BHolder<IComboBoard>	board;
		BArray<BComboItemHolder>	items;
	};
}

#endif